import java.util.Arrays;

public class Code4 {

    public static void main(String[] args) {

        int[] arr = {1,2,3,4};
        arr = func(arr);
        System.out.println(Arrays.toString(arr));

    }

    public static int[] func(int[] arr){

        int len = arr.length;
        int num = 0;
        for(int i=0; i<len; i++){
            if(0 != arr[i]){
                num++;
            }
        }

        int x = (int)(len*0.8);

        if(num>=x){
            len = (int)(len*1.5);
            int[] arr1 = new int[len];
            for(int i=0; i<arr.length; i++){
                arr1[i] = arr[i];
            }
            return arr1;
        }
        return arr;
    }
}
